
public class Text {
      public static void main(String[] args) {
            TextBinaryTree  textBinaryTree = new TextBinaryTree();
            TextBinaryTree.TreeNode root = textBinaryTree.createTree();
            System.out.println("先序遍历:");
            textBinaryTree.preOrder(root);
            System.out.println();
            System.out.println("中序遍历:");
            textBinaryTree.inOrder(root);
            System.out.println();
            System.out.println("后序遍历:");
            textBinaryTree.postOrder(root);
            System.out.println();
            System.out.println("节点个数:");
            int size = textBinaryTree.size(root);
            System.out.println(size);
            int size2 = textBinaryTree.size2(root);
            System.out.println(size2);
            System.out.println("叶子节点个数:");
            int leaf = textBinaryTree.getLeafNodeCount(root);
            System.out.println(leaf);
            int leaf2 = textBinaryTree.getLeafNodeCount2(root);
            System.out.println(leaf2);
            System.out.println("第k层节点个数:");
            int kLeave = textBinaryTree.getKLeavelNodeCount(root,3);
            System.out.println(kLeave);
            System.out.println("层序遍历：");
            textBinaryTree.levelOrder(root);
            System.out.println("是否为完全二叉树");
            System.out.println(textBinaryTree.isCompleteTree(root));
            System.out.println("非递归后序遍历");
            textBinaryTree.postOrdernor(root);
      }

}
